package com.sc.nft.entity.vo.salvageEvents;

import com.sc.nft.enums.DaoEcologyPointsDetailAmountTypeEnum;
import com.sc.nft.enums.DaoEcologyPointsDetailRecordsTypeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;

@Data
public class PageDaoEcologyPointsTransferRecordsVO {


    @ApiModelProperty(value = "dao id")
    private Long daoId;

    @ApiModelProperty(value = "dao名称")
    private String daoName;

    @ApiModelProperty(value = "目标用户id")
    private Long toUserId;

    @ApiModelProperty(value = "目标用户昵称")
    private String toUserTel;

    @ApiModelProperty(value = "燃料类型 : AVAILABLE:可用燃料 RELEASE:待释放燃料")
    private DaoEcologyPointsDetailAmountTypeEnum amountType;

    @ApiModelProperty(value = "燃料类型名称")
    private String amountTypeName;

    @ApiModelProperty(value = "记录类型 : TRANSFER_TO_MARKET_VALUE_ACCOUNT:转至市值账号")
    private DaoEcologyPointsDetailRecordsTypeEnum type;


    @ApiModelProperty(value = "类型名称")
    private String typeName;

    @ApiModelProperty(value = "金额")
    private String amount;

    public void setAmount(BigDecimal amount) {
        this.amount = amount.stripTrailingZeros().toPlainString();
    }

    public void setAmountType(DaoEcologyPointsDetailAmountTypeEnum amountType) {
        this.amountType = amountType;
        this.amountTypeName = amountType.getDescription();
    }

    public void setType(DaoEcologyPointsDetailRecordsTypeEnum type) {
        this.type = type;
        this.typeName = type.getDescription();
    }
}
